adding gcd and k nearest neighbour