made a recursive traverseEast function