added slots, rearranged histogram extraction