Make gsa() more generic