Implemented setting of the direction.