added some code comments