Consider two independent sequences $X_1,\ldots, X_n$ and $Y_1,\ldots, Y_n$. Suppose that $X_1,\ldots, X_n$ are i.i.d. $\mu_X$ and $Y_1,\ldots, Y_n$ are i.i.d. $\mu_Y$, where $\mu_X$ and $\mu_Y$ are distributions on finite alphabets $\sigma_X$ and $\sigma_Y$, respectively. A score $F: \sigma_X \times \sigma_Y\rightarrow \mathbb{R}$ is assigned to each pair $(X_i, Y_j)$ and the maximal nonaligned segment score is $M_n = \max_{0\leq i, j\leq n - \Delta, \Delta \geq 0} \{\sum^\Delta_{k=1} F(X_{i+k}, Y_{j+k})\}$. The limit distribution of $M_n$ is derived here when $\mu_X$ and $\mu_Y$ are not too far apart and $F$ is slightly constrained.