Added docstrings for everything, did a litte cleanup of some functions and fixed a bug where the value of the monitor wasn't being saved out properly.