Added support for multiple diagrams
Added support for multiple diagrams