completed implementing queue: query value