clean up calculations