splitting boundary conditions into left and right ones