changed array to ArrayList so size can vary