Major improvement to the docs. Given better examples and more complete
code