separate histogram from curvetool, in progress...