boundary conditions working