public static SpriteFrame getFrame(String ref, int width, int height, int x, int y) {
		//retrieve a single frame of a sprite from a Sprite in the hashmap 
		//if the sprite is not already in the hashmap, call getSprite(ref) to load the
		// image, then use the given parameters to return a single frame
		BufferedImage sourceImage = (BufferedImage) getSprite(ref).getImage();
		
		// create an accelerated image of the right size to store our sprite in
		GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
		Image image = gc.createCompatibleImage(width, height, Transparency.BITMASK);
		
		// draw our source image into the accelerated image using Image.getGraphics().drawImage() into the specified image
		image.getGraphics().drawImage(sourceImage, 0, 0, width, height, x, y, x+width, y+height, null);
		// create the sprite and return it
		SpriteFrame sprite = new SpriteFrame(image);
		
		return sprite;
	}