Made checkOutput parallel and added a flag to toggle it.