refactored the code, added pybuilder project and some tests