faster histogram