@Override
    public void run() {
        if (bot.hasPrivateMessage()) {
            message = bot.getPrivateMessage();
        }

        if (message.startsWith("~register")) {
            tokenize(false, 9, message);

            try {
                encryptor = MD5.getInstance();
                register  = new Properties();
                access    = new Properties();
                userFile  = new File("config/users.properties");
                accessFile = new File("config/access.properties");

                /*writes to passwd file, ex. user=SDFA234FSE434*/
                if ( !userFile.exists() ) {
                	userFile.createNewFile();
                }
                register.load(new FileInputStream("config/users.properties"));
                register.put(bot.getPrivateSender(),
                        encryptor.hashData(parameters.getBytes()));
                register.store(new FileOutputStream("config/users.properties"), null);
                
                if ( !accessFile.exists() ) {
                	accessFile.createNewFile();
                	firstRun = true;
                }
                access.load(new FileInputStream("config/access.properties"));
                if (firstRun) {
                	access.put(bot.getPrivateSender(), "4");
                } else {
                	access.put(bot.getPrivateSender(), "0");
                }
                access.store(new FileOutputStream("config/access.properties"), null);
            } catch (NoSuchAlgorithmException ex) {
                Logger.getLogger(Register.class.getName()).log(Level.SEVERE,
                        null, ex);
                System.err.println("couldn't create md5 object");
            } catch (IOException ex) {
                Logger.getLogger(Register.class.getName()).log(Level.SEVERE,
                        null, ex);
                System.err.println("Input Output error");
            }

            Main.bot.sendMessage(bot.getPrivateSender(),
                    "registration successful ");
        }
    }