updated code to adjust for single interest