fixed bug where /g and /-g would be the same, added math.floor for preventive reason