fixed math's stuff