missed minimization in pseudocode
code for multiple end-to-end runs