added support for soft boundaries