tidy up the handPotential function