I just copied the code from the same file.  validate_bool() is much more elegant.  Thanks.