added some comments
minor tweaks