Creating openFile method
Refining openFile method