refactored window.directions