made slight improvement to size method in arraylist