fixes #804: clean up implementation of #803 (which fixed #781)

I also changed it to be median of 5, since it's now trivial to choose
any number of runs.