adaptation to Windows
changed cout redirection to streambuf