made some math changes