Clean up debug code
Add documentation for monitor