Added Monitor test and revised some code and changed Makefile