added implementation of queue