macro expansion re-written to take care of local variables.
lazy functions.