pass by reference instead of value for the histogram pyramids