modified diagram for template