use drop rather than calculate the array length