move waypoints find function back to directive because range is stored in it's scope