update algorithim to use current math