Changed to printwriters and bufferedreaders