adjust near neighbour script to output nn values rather than histogram