implement statistical error in metastable calculation. not fully tested