added proper file opening to another method
??