improving file writing capabilities