moved parser to top-level so that it's only called once.  added iterative algorithm to search for min stddev over many randomized scenarios