using lists as stacks