add function to calculate interest allocated for a payment