parse stacks