added directional JS code