ok, tgtLen is updated at the bottom