moving transformstats function to separate file

primarily to make it easier to reference