The 'searchsorted' pattern is great, but can be a bit hard to wrap ones head around. I think that it would be great if you could add a small comment explaining what it does.