add the code for the direct calculation of Green's function