implement cache solve function