Added a check/fold function.