Replaced write and added writeln function. Now write won't break the line