Refactored using writeln for each kind of expression
Added basic write/writeln generation