refactored calculateHandValue()