changes to histogram function