change to overflow calculation