Part 3 changed array to arraylist