updated documentation, refactored demos.