added comments to explain radiobutton logic