working on mesh, cleaning code