Updated Documentation

Split large example into code snippets with explanations