Minor cleanup and commenting
resolved merge conflicts