Implemented double buffering of state in sequential loops (forLoop and whileLoop).
Minor polishing.
Some more polishing to address review comments.