fixing a precendence issue with / and % to ensure we do the arithmetic first