now using size() to get the size of the array