fixed some math things