public static BufferedImage openImage()
    {
        try
	{
            int val = fileChooser.showOpenDialog(CS355Frame.inst());
		
            if (val == JFileChooser.APPROVE_OPTION)
            {
		File file = fileChooser.getSelectedFile();
			
		BufferedImage img = javax.imageio.ImageIO.read(file);
				
		if (img == null) throw new Exception("unable to read image");
				
		return img;
            }
	}
	catch (Exception e)
	{
            e.printStackTrace();
	}
		
	return null;
    }