nearest neighbour done