fixed some bugs and compute min/avg overlapping views