caching array length