Added Tim Graham's changes.