added user defined metric to isomap and nearest neighbour