Changed into  ArrayList from array.