added mergeLeft function