@SuppressWarnings("unchecked")
	@Override
	public void onEnable(){	
		logger = getLogger();
		logger.info("Chest Screen Plugin Author: Tim Kerr (Kloudy)");
		logger.info("Reading display data from file");

		//read display data from file
		 try{
			 File folder = new File("plugins/DisplayData");			 
			 if(!folder.exists()){
				 folder.mkdir();
			 }
			 
			 File file = new File("plugins/DisplayData/displayData.ser");
			 
			 if(!file.exists())
				 file.createNewFile();
			 
	         FileInputStream fileIn = new FileInputStream(file);
	         ObjectInputStream in = null; 
	         displayManager = DisplayManager.getInstance();
	         displayManager.displays.put(-1, new ArrayList<Display>());
 
	         //don't open input stream if file is empty
	         if(file.length() > 0){
	        	 in = new ObjectInputStream(fileIn);  
	        	 displayManager.displays = (HashMap<Integer, ArrayList<Display>>) in.readObject();
	        	 getLogger().info(displayManager.displays.toString());
	        	 Display.newID = displayManager.displays.get(-3).get(0).getChestID();//initialize display object counter
		         in.close();
	         }
	         
	         //no data in the file (on first start)
	         else{
	        	 Display.newID = 0;//initialize display object counter	
	         }
	         	         
	         displayManager.displays.put(-2, new ArrayList<Display>());//initialize pending displayManager.displays list
	         displayManager.displays.put(-3, new ArrayList<Display>());
	         displayManager.displays.get(-3).add(new Display(null, null, Display.newID ,null, null, null));//keeps track of number of displayManager.displays created
	         fileIn.close();
         
	 		 getServer().getPluginManager().registerEvents(new BlckBreakEvent(displayManager.displays), this);
	 		 getServer().getPluginManager().registerEvents(new OnInteractEvent(displayManager.displays, getWorldGuard()), this);
	 		 getServer().getPluginManager().registerEvents(new RedstoneEvent(), this);
	 		 getServer().getPluginManager().registerEvents(new SignEvent(displayManager.displays), this);

	 		getCommand("cd").setExecutor(new OnCommandEvent());
		 }
		 catch(IOException i){
	         i.printStackTrace();
	      }
		 catch(ClassNotFoundException c){
	         c.printStackTrace();
	      }
	}