much refactoring
Added assign stmts