added in a proper example of caching for array length