modified arraylist to use generics