removing everything not in scope