Fleshed out the background subtraction.