Update pseudo code and comments for direction