remove reference to redundant variable
some comments and minor changes
add comments to zcas and remove unused variables