Updated js file to encorporate directions