added histcn() to replace ndhist()

ndhist() crashes sometimes