I fixed arraylist problem, and also removed unused code