# Review Algorithmic Thinking by Building a Dice Game - Step 7

### Tell us what’s happening:

my code is working, but it is not being accepted, I tried a cumulative score, but also doesnt work
error:
When the array has four of the same number, your `getHighestDuplicates` function should also update the `Three of a Kind` radio option with `, score = ` and the total sum of the dice.

I tried the cumulative score because of the error that says `four of the same number` for a `Three of a Kind` radio option, code works but still doesnt pass.

``````<!-- file: index.html -->

``````
``````/* file: styles.css */

``````
``````/* file: script.js */
// User Editable Region

function getHighestDuplicates (diceValues) {
const frequencyMap = {};
diceValues.forEach(value => {
frequencyMap[value] = (frequencyMap[value] || 0) + 1;
});

const totalScore = diceValues.reduce((sum, value) => sum + value, 0);

let hasFourOfAKind = false;
let hasThreeOfAKind = false;

Object.values(frequencyMap).forEach(count => {
if (count >= 4) {
hasFourOfAKind = true;
} else if (count >= 3) {
hasThreeOfAKind = true;
}
});

if (hasFourOfAKind) {

} else if (hasThreeOfAKind) {

} else {

}
};

if (rolls === 3) {
} else {
rolls++;
rollDice();
getHighestDuplicates(diceValuesArr);
}
});

// User Editable Region
``````

User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36`

### Challenge Information:

Review Algorithmic Thinking by Building a Dice Game - Step 7

Welcome to the forum @ihmusarevalo02

Try removing the `else` keyword.

Remove the `else` condition from the last option.

Happy coding

Try this:

ive got it after trying again and analyzing the exact error message over and over.
gotta have patience and better comprehension of error messages

When the array has four of the same number, your `getHighestDuplicates` function should also update the `Three of a Kind` radio option