updated layout function to avoid VertexData