fixed bad math