Move compare to do..while