fixed an error in a while loop
Added debug printouts and removed the FIFO