changed writeline code