Returning histogram array from a function