Updating alignUngapped so that it updates the array of matches only when it would in the C++ code