clearing some debt.  writing tests and minor tweaks.