latex code, updated diagrams and cost