Replaced all heightForIndex for loops with cached call