A couple simple changes, plus a lot of documentation, plus some tests