This operation is really slow for someone with a lot of content, but I found myself spending too much time trying to optimize it. Suggestions welcome.