add p and g support