reformulated the derivation of the greens functions