Replace functions with recursion
Fix functions for identing the hand