broken implementation of queue