updated to use mbx's diagrams