complete rewrite for eventual search engine