correct some bugs and replace some hacks
add README.md for documentation