simple example using queue and stacks