changed how array is emptied