merge left and right sides