minor changes, added comments