introduce distance threshold to ignore noise