added two arraylist and updated index system