made nearest neighbor more efficient, fixed indentation
fixed nearest neighbor search w/ set iterator