added file opening functionality