updated monitor.c