Attempt to implement k nearest neighbour