Implemented the basick backtracking for Smith-Waterman