Code for selecting the best ST for a site -- updated