New function with histogram added.