moved away from IO::write to File::open