Improved documentation and demos

It needs to go in a function, but it doesn't need to be self-executing. Added that commit to this PR