Removed unused gcd, to_string, some formatting