Fixes on directions.js

Removed unused portions of the code