Adding function for creating generic functions for gvector