You can use the LEN function to get the length of the array, so you don't have to keep track of it yourself.