second part of adding the boundary term