set s and g