I could use the second example, modified it a bit. Now i only have to find a way to insert type into the mesh.