added makro to shrink an array by resetting the length