Fixed a bug in the order of searching for the best edge space in Needleman-Wunsch alignment