changed newClasses to ArrayList