debugging and tying up loose ends