Second refactor - renamed parameter passed to amountFor function and removed unnecessary first parameter