First implementation, queue