I assumed that is was based on score, but then I beat a level in less moves but with a lower score and received a higher rank. If the rank is based on remaining moves, just like the pokemon's catchability, what is the purpose of receiving a score?