Replaced old stats functions with a single function that returns a df

resolve #2