code cleanup in gapfill.js