changed some math