Added functions to open files