Add handling of direction and by-direction
Additional functionality needed to match description in README.md