opening file and some funcitons
for god sake