adding functions for fast empirical distributions