moved more unused code from stats.r to notused.r