added multiple cubes and and segmented averages