diagrams implementation