added support for surrounding rule

changed to environment because of naming conflict
working version, tested on Empty API
changed to new syntax

it works!