Add set_direction method, as the c version had one