inserted stop condition based on comparative standard deviation between runs
fixed bug in median requirement