fixes math errors with last commit