Changed Integer[] to ArrayList and updated all classes