adding file writing capabilities