added comments inline

several comments on different parts of the query. they are marked inline...