function plotContourWithGD(theta0_vals, theta1_vals, J_vals, theta_path, z_vals)
    figure;
    contour(theta0_vals, theta1_vals, J_vals', z_vals, 'LineWidth', 2);
    xlabel('Theta 0');
    ylabel('Theta 1');
    title('Contours of intersection between planes and the cost function');
    colorbar;
    
    hold on;
    plot(theta_path(1,:), theta_path(2,:), 'r-o', 'LineWidth', 2, 'MarkerSize', 5);
    legend('Contours', 'Gradient Descent Path');
    hold off;
end
