changed from arraylist to array