made progress in understanding operation. added comments.