reorganize scalar_stats.jl