with structure of arraylist