adding a save balance curve function