Simplify by using existing write method.
Working on Windows now