modified sgv_p to reference templated elements