finished remove function.  It's a doozy.