Its part of a content management system. The output is sent to a template at build time. The actual code outputs a selection of categories from the DB, picked at random. This allows me to feature, say 100 category items on the home page. A much better presentation would be if these are then sorted by ascending order.