Calculating interest with functions