made stdin/stdout mutable and added beginning testing