cleaning up some math