simplifying some math