working on support for loop boundaries