Modified work with boundary condition