in process of fixing fifo functions