bad math fix