Made more dynamic when selecting rank by comparing to ArrayList size
rather than a constant.