Added 'if' statements to function at each coin denomination

Seems verbose but it works