Change ArrayList to ArrayDeque