implement cache solve