Generating texture coords for terrain

What am I doing wrong?

Heres code for uv generation

// generate vertices
        for(int x = 0; x < size; x++) {
            for(int z = 0; z < size; z++) {
                float px = x / (float)  noiseScale;
                float pz = z / (float)  noiseScale;

                /*
                 * Sample the module chain like this...
                 */
                float v = (float) ridged.get(px, pz);
                //v = Math.max(0, Math.min(1, v));
                verticesPosition.add(new Vector3f(x * spacing, v * heightScale, z * spacing));
                
                //generate UV coords
                verticesUV.add(new Vector2f(x / size, z / size));
            }
        }
Mesh mesh = new Mesh();
        mesh.setBuffer(VertexBuffer.Type.Position, 3, BufferUtils.createFloatBuffer(verticesPosition.toArray(new Vector3f[0])));
        mesh.setBuffer(VertexBuffer.Type.Normal, 3, BufferUtils.createFloatBuffer(verticesNormal.toArray(new Vector3f[0])));
        mesh.setBuffer(VertexBuffer.Type.TexCoord, 2, BufferUtils.createFloatBuffer(verticesUV.toArray(new Vector2f[0])));
        mesh.setBuffer(VertexBuffer.Type.Index, 3, listToBuffer(indices));
        mesh.scaleTextureCoordinates(new Vector2f(5, 5));
        mesh.updateBound();
Geometry geo = new Geometry("OurMesh", mesh); // using our custom mesh object
        Material mat = new Material(main.getAssetManager(), "Common/MatDefs/Light/Lighting.j3md");
        mat.setTexture("DiffuseMap", main.getAssetManager().loadTexture("Textures/ground.jpg"));
        //mat.setColor("Color", ColorRGBA.Blue);
        mat.setColor("Diffuse",ColorRGBA.White);
        mat.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);
        //mat.getAdditionalRenderState().setWireframe(true);
        
        geo.setMaterial(mat);
        main.getRootNode().attachChild(geo);