Is this really positive? In a substitution matrix this would be negative so that you can always add the substitution score (i.e., you don't need to know if it's a reward (which should be added) or penalty (which should be subtracted)). Just want to confirm as it seems odd, but I know it's an SSW thing, not a feature of your code.