Necessary and sufficient factors in classical conditioning