update history and setup.py
add a test and fix some issues