removed an unused header file
delete unused files.
trimmed white spaces of end of lines.
changed the timing of calling waitForBytesWritten().