implemented direction feature