filter undef
count the elements
debug array element count
delete empty elements
remove debug