fixing bad math