added some minor comments to a very nice implementation