Improvements on pairwise alignment