ENH Marking private functions and changing file opening  to use with