set up pseudocode idea for traversing stacks