public void addUser(String username, String password) 
			throws DuplicateUserException, BadUsernameException, BadPasswordException{
		
		if(username == null || username.length() == 0){
			throw new BadUsernameException("Invalid username");
		}
		if(password == null || password.length() == 0){
			throw new BadPasswordException("Invalid password");
		}
		if(users.containsKey(username)){
			throw new DuplicateUserException("User already exists");
		}
		users.put(username, hash(username,password));
		/* updates source file */
		FileWriter out = null;
		try{out = new FileWriter(mSource,true);}
		catch(FileNotFoundException e){}
		catch (IOException e) {}
		try{
			out.write(username);
			out.write(":");
			out.write(users.get(username));
			out.write("\n");
			out.close();
		}catch(IOException e){}
	}