Code commenting and some minor cleanups