Changed method of getting indices of views to a much better, more reliable, and scalable method.