fix bad math