Refactored LocalAlignmentLinear