Added diagrams and improved documentation