made code more elegant, closes other readers in fifo.c instead of in main.c