finish algo of FIFO and make driver modular