added % operator and gcd function