public Sprite load(String spriteName)
  {
    if (cache != null)
    {
      if (cache.containsKey(spriteName))
            return (Sprite)cache.get(spriteName);
    } 
    BufferedImage sourceImage = null;
    try{
      sourceImage = ImageIO.read(new File(spriteName));
      System.out.println("this managed to load"+ spriteName);
    }
    catch(IOException e)
    {
      displayErrorMessage("There was an error loading the file '" + spriteName + "'. Please ensure the file exsists in the specified directory");
    }
    //Convert the loaded image into an internal java accelerated image format.
    GraphicsConfiguration graphicsConfig = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
    Image image = graphicsConfig.createCompatibleImage(sourceImage.getWidth(),sourceImage.getHeight(), Transparency.BITMASK);
    image.getGraphics().drawImage(sourceImage,0,0,null);
    //Load the accelerated image into a Sprite object for convinience.
    Sprite sprite = new Sprite(image,spriteName);
    cache.put(spriteName, sprite);
    return sprite;
  }