update dist threshold, add directional threshold