renamed main factoring method. Fixed equals bug in gcd. Inlined gcd and g(x) to hopefully make it run quicker