implement simple functions for cvector