merge make_guess() into solve(), split out raise_if_invalid