Finished code for status monitor.