I tried creating an ArrayList but it is not working.