Implement successor function for ToH