created method to calculate the value of a hand