Implement support for backward counting for loops