Added function to print frequency histogram