Updated to test writing to output