fixing funcs for calculating empirical distributions