make GlobalAlignment() take O(N*(M-N)/2) time. This results in an approximate 2x speed improvement.