added reading file functions