Replaced length function with length property created on-demand