added some explanatory comments to vauge code