public void simpleInitApp() {

		/** Create a pivot node at (0,0,0) and attach it to the root node */
		com.jme3.scene.Node pivot = new com.jme3.scene.Node("pivot");
		rootNode.attachChild(pivot); // put this node in the scene
                
                boolean hasNormals = false;

		Vector3f [] vertices;
                Vector3f [] normals;

		ArrayList<Integer> mIndices = new ArrayList<Integer>();

		ArrayList<Float> mColors = new ArrayList<Float>();

		Mesh mesh = new Mesh();

		File amfFile = new File(filepath);

		NodeList nList = getElements(amfFile, "vertex");
		NodeList mList = getElements(amfFile,"triangle");

		vertices = new Vector3f[nList.getLength()];
                normals = new Vector3f[nList.getLength()];

		populateIndicesColors(mList, mColors, mIndices);

		populateVertices(nList, vertices, normals);

		Vector3f [] newVertices = new Vector3f[mIndices.size()];
                Vector3f[] newNormals = new Vector3f[mIndices.size()];

		ArrayList<Integer> indices = new ArrayList<Integer>();

		setFinalVertices(mIndices, indices, vertices, newVertices, normals, newNormals);

		int[] indexes = new int[indices.size()];
                
		for(int i=0; i<indices.size();i++){
			indexes[i] = indices.get(i);
		}
               
		mesh.setBuffer(VertexBuffer.Type.Position, 3, BufferUtils.createFloatBuffer(newVertices));
		//mesh.setBuffer(Type.TexCoord, 2, BufferUtils.createFloatBuffer(texCoord));
		mesh.setBuffer(VertexBuffer.Type.Index, 3, BufferUtils.createIntBuffer(indexes));
                //mesh.setBuffer(VertexBuffer.Type.Normal, 3, BufferUtils.createFloatBuffer(newNormals));

		mesh.updateBound();

		Geometry geo = new Geometry("OurMesh", mesh); // using our custom mesh object
                
                //
                
                if(normalsSet){
                    
                    System.out.println("normals");
                    
                    mat = new Material(assetManager, //"Common/MatDefs/Misc/ShowNormals.j3md");
				//"Common/MatDefs/Misc/Unshaded.j3md");
                        "Common/MatDefs/Light/Lighting.j3md");
                    
                    mat.setBoolean("UseMaterialColors", true);
                    mat.setColor("Diffuse", ColorRGBA.Blue);
                    mat.setColor("Ambient", ColorRGBA.Red); //Using white here, but shouldn’t matter that much
                    mat.setColor("Diffuse", ColorRGBA.White);
                    mat.setColor("Specular", ColorRGBA.Yellow); //Using yellow for example
                    mat.setBoolean("VertexLighting", true);
                    
                    mesh.setBuffer(VertexBuffer.Type.Normal, 3, BufferUtils.createFloatBuffer(newNormals));
                
                    DirectionalLight light=new DirectionalLight();
                    light.setDirection(new Vector3f(-1, 0, -1).normalizeLocal());
                    light.setColor(ColorRGBA.White);
                    getRootNode().addLight(light);
                
                    DirectionalLight light2=new DirectionalLight();
                    light.setDirection(new Vector3f(1, 0, 1).normalizeLocal());
                    light.setColor(ColorRGBA.White);
                    getRootNode().addLight(light);

                    AmbientLight ambient = new AmbientLight();
                    ambient.setColor(ColorRGBA.White/*.mult(0.5f)*/);
                    getRootNode().addLight(ambient);
                } else{
                       System.out.println("no normals");
                       mat = new Material(assetManager,
				"Common/MatDefs/Misc/Unshaded.j3md");
                        if(mColors.size() > 0){
                            System.out.println("Colors");
                            float[] colors = new float[mColors.size()];
                            for(int i=0;i<mColors.size(); i++) {
                    		colors[i] = mColors.get(i);
                            }
                            mesh.setBuffer(Type.Color, 4, colors);
                            mat.setBoolean("VertexColor", true);
		} else{
			//mat.setColor("Color", ColorRGBA.Blue);
                    
		}
                }
                

                //
                

		mat.getAdditionalRenderState().setWireframe(true);

		geo.setMaterial(mat);
		rootNode.attachChild(geo);

		BitmapFont fnt = assetManager.loadFont("Interface/Fonts/Default.fnt");
		txt = new BitmapText(fnt, false);
		txt.setBox(new Rectangle(0, 600, 400, 100));
		txt.setSize(fnt.getPreferredSize());
		txt.setText("Click and Drag to rotate camera. Use arrow keys to move camera. JK to toggle wireframe/solid. X to close this text.");
		txt.setLocalTranslation(0, txt.getHeight(), 0);
		guiNode.attachChild(txt);


		initKeys();
		flyCam.setDragToRotate(true);
		flyCam.setMoveSpeed(7);

	}