OK.  I've replaced usage of the check_goessat() with these lines of code.  I haven't made a separate function as it's only used twice and makes the code more easily transparent to a reader.  I don't think it merits it's own function.