The way to apply payments is as follows:
Calculate interest in the principal due: If balance = $1000, and i = 0.025, interest is $25
Calculate the amount to principal which is the monthly payment minus the interest due: $518.83 - $25 = $493.83
Calculate the principal remaining, which is the previous principal remaining minus the amount applied to principal: $1000 - $493.83 = $506.17 (remaining balance)
Once next payment is received, repeat steps 1 to 3.