refactored Mesh; changed Math namespace to math