added histsize as global variable