made makefile, fixed queuelinked and RI.cpp