changed ArrayList to generic ArrayList<T>