Cache function and solve function finished