using write instead of print on output stream.