// While there is still money of this type in the drawer
// And while the denomination is larger than the change remaining
while (register[curr.name] > 0 && change >= curr.val) {
change -= curr.val;
register[curr.name] -= curr.val;
value += curr.val;