More work on the check function.