merge methods calculate_compound and calculate_compound_amount into calculate_compound_amount