Make Gaussian removal code much simpler by putting it in the right place