now using one function to generate geometry from the lists of vertices,