some changes in mergejoin