iterative merge

was finding difficult to fix the boundary conditions.... but this worked fine now