Implemented conditional nesting level evaluation