fifo queue but is possible to do better