added setup.py and fixed bug in parsing