Updated file opening