opens file and saves to variable