Updated code for 8 coins