redo im_histnD() as a class
start on indexed hist