created mesh and attach utility functions.