yet another rewrite of check