A lot of experimentation, a few fixes