modified to use only cardinal directions