Fragile but seems to be working.