added a direction to point conversion function