cleaned up and commented code, few bug fixes, updated readme