removed some unnecessary stuff and made a function to cover all the needs of finding the nth highest ranking card