Added begining of card ranking algorithm