copy length of patter items array before removing the first item from it. #25