Starting work on extend_match; making a copy of extend_match that carries out gapped extension in the same way as in the C++ code