compile histogram code updated