adding doc.
...and some minor improvements.