Implemented checkSet and checkNegate. Refactored "store" to "cache" when
applicable, since that name is more descriptive.