Added open file function