Refactored code, added setup.py