I think it's done

This should be the final commit, unless I find some bugs.