completed solution for coin determiner