first stab at ads

Do not merge yet,
For review only now
I don't think defining this function (or the next function, hop) here is the most eloquent or performant solution. I think you can declare it outside and still achieve privacy, while decreasing nesting levels and hence, complexity.