Changed bufferedwriter to printwriter