better boundary conditions