restructured main script and added setup.py