export functions stat and plotStats