adding withinDistance test