score = (x) -> if x == "Yes" 10 else 0 weights = [0.5, 0.5] identifying_risks = [identifying_risks_and_impacts, identifying_partner_risks_and_impacts] weights.reduce((weighted_sum, weight, index) -> weighted_sum + weight*score(identifying_risks[index]) , 0)