More work on the check funciton.