working 1-D queue example