Added state read and write to FIFO