594: save array length as global var