fixes ranking but, and tie bug