Modest overhaul of gab analysis code