Remove plotting code and rename calcUncertainty