Created utility functions for working with directions