merging closed on memory spaces in lambda functions so we can have access to outside items