A whole bunch of commenting and code tidying
fixed a save bug