implement length of array condition