revise loss calculation to prevent excessisve reordering for unaligned
words