Refactored comparison logic into Hand