Add a main function, fix a parameter type and add comments.
Update README.