add an instances function as helper to histogram func