minor changes; added comments