Optimization - changed sorting function to sort highest-to-lowest, and removed the reverse() step from two places.