static int gcd(int p, int q) throws IllegalArgumentException {
		if (q < 0 || p < 0) throw new IllegalArgumentException("Integers must be non-negative");
		
		if (q == 0)	return p; // base case
		 
		int r = p % q;
		return gcd(q, r);
	}