Won't go crazy on code review since this is marked WIP but I think there is an `end` missing here.