Initial version of gapfilling. Sometimes works.