A local Crank-Nicolson method for solving the heat equation