making classes that needn't be public private, adding automatic file closure, adding new tests