minor commit - only close file if file is opened (at the first place)
Covered all documentation for all classes and methods, with examples.