I agree that your solution works with opening and closing twice on slide. I'm sure I moved away from that for some reason but can't find hy. In any case; looks nice and more readable.