adjusting the semantics to deal with writeln-statement