updated with diagrams