Add version
Use class to do it; fix #7
Refine code: pep8