Construction of frequency distribution