sketch of check code