add some functions for meshing