added mod helper to maths