Improve documentation

Improve the documentation both inside the script itself and in the
README.