Updating code with Andrew R's modifications (intercept point) and reducing stop_strategy distance.