implemented regex word reordering