added comments, and an assert.