The indentation in this section could use some work. It's difficult to see what this `end` refers to.