detects directions