add openfile.o
new function for opening file
use new openfile function