add fritz diagrams, clean up code