Bug fixes to jiggleAlgo string and picking the best one