code formatting updates, added an explicit container.remove() call.