Changed to bufferedwriter