added more comments
more cleanup
more standardization of parms