added pseudocode for the backtrack function