changed to bufferedstreams