preparations for histogram mode