Initial commit of function calculate_coins