incorporated fixes from hamid for station selection