Finished the automatic query construction.  Implemented for leagues.