working on arraylist index out of bounds error