changed distance threshold to 200