added comments and removed redundant assign.