added javadoc to methods and solved the CSVWriter closing twice problem. Related to #10 and #20