rename some variable to avoid confusion
code cleaning
throw exceptions
add a new example
modified output format
modified output format
update README.md