Wrote nearest neighbor algo. Compiles but not yet tested