implementing Isomap, but it's SLOW