calculate interest code