Fixed some bugs and finished the routine to make the elmer meshes