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.
Merge pull request #805 from michaelficarra/GH-804

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