putting the diagram first