**Tell us what’s happening:**

I’m currently trying to finish this Cash Register Project, and I am a bit stuck on the third test. I know I cannot pass the 5th test, because my code does not yet handle it.

However, I don’t understand the result I get when trying the 3rd test : I get this :

“TWENTY,80,TEN,10,FIVE,5,ONE,1,QUARTER,0.5,DIME,0.2,PENNY,0.04” instead of

“[[“TWENTY”, 60], [“TEN”, 20], [“FIVE”, 15], [“ONE”, 1], [“QUARTER”, 0.5], [“DIME”, 0.2], [“PENNY”, 0.04]]”

I don’t understand what I did wrong here

If anyone could point me in the right direction, it would be greatly appreciated ! Thanks a lot

**Your code so far**

```
function checkCashRegister(price, cash, cid) {
var change = {status: ' ', change: []};
let changeDue = (cash-price)*100;
const unitsName = ["ONE HUNDRED","TWENTY","TEN","FIVE","ONE","QUARTER","DIME","NICKEL","PENNY"];
const unitsValue = [10000,2000,1000,500,100,25,10,5,1];
var quantity, amount;
let sumCid = (cid.reduce((a, b) => a + b[1], 0))*100;
let changeGiven = getExactChange(changeDue);
function getExactChange(changeDue) {
var changeTogive = [];
for (let i = 0; i < unitsValue.length; i++) {
quantity = Math.floor(changeDue / unitsValue[i]);
if (quantity > 0) {
changeTogive.push(unitsName[i]);
amount = (quantity * unitsValue[i])/100;
changeDue = changeDue % unitsValue[i]
changeTogive.push(amount);
}
}
return changeTogive;
}
//final statement
if (changeDue === sumCid) {
change.status = "CLOSED";
change.change = cid;
} else if (sumCid < changeDue /*or not enough coins*/) {
change.status = "INSUFFICIENT_FUNDS";
change.change = [];
} else {
change.status = "OPEN";
change.change.push(changeGiven);
}
console.log(change.status);
console.log(changeGiven);
return change;
}
checkCashRegister(3.26, 100, [["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.1], ["QUARTER", 4.25], ["ONE", 90], ["FIVE", 55], ["TEN", 20], ["TWENTY", 60], ["ONE HUNDRED", 100]])
```

**Link to the challenge:**

https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/cash-register/