fixed some math