private void cleanUp(){

    File SKIN_DIR = skin_file.getParentFile();

    for(int i = surface_names.size()-1; i >= 0; i--){
      File texture = texture_paths.get(i);

      File parent = texture;

      //search for the right entry folder in the given path of the skinfile
      ArrayList<String> folder_names = new ArrayList<String>();

      while( parent != null){
//        System.out.println("parent..." + parent.getAbsolutePath());
        String folder_name = parent.getName();
        
        if( SKIN_DIR.getName().equals(folder_name)){
          break;
        }
        folder_names.add(folder_name);
        parent = parent.getParentFile();
      }
      
      //didnt find any match
      if( parent == null ){
        System.err.println("("+skin_file.getName()+") texture unavailable: "+surface_names.get(i)+", "+texture);
        surface_names.remove(i);
        texture_paths.remove(i);
        continue;
      }
      

      // rebuilding path, to search for right file
      File child = SKIN_DIR;
      for(int j = folder_names.size()-1; j >= 0; j--){
        child = new File(child, folder_names.get(j));
        if( !child.exists() ){
          break;
        }
      }
      if( !child.exists() ){
        System.err.println("("+skin_file.getName()+") texture unavailable: "+surface_names.get(i)+", "+texture);
        surface_names.remove(i);
        texture_paths.remove(i);
        continue;
      }
      
      //if the file exists:
      // change current path in "surface_textures" to real path.
      texture_paths.set(i, child);
    } 
  }