Added some sequence diagrams and doc comments.