added some code to display array count as needed