updating mesh and math