private void loadUserData(String fileName) {

        Scanner sc = new Scanner(System.in);

        // if the file does not exist,
        // create it.
        File f = new File(fileName);
        try {
            if (f.createNewFile()) {

                // the first time the system is started
                // this will create an ADMIN group
                System.out.println("The database file has not been detected.");
                System.out.println("Please input the name of your Admin:");

                System.out.print("Username: ");
                String newAdmin = sc.next();

                System.out.print("Password: ");
                String pass = sc.next();

                HexString hex = new HexString();
                pass = hex.toHexString(SecurityManager.digest(pass.getBytes()));
                pass = hex.toHexString(SecurityManager.digest(pass.getBytes()));
                
                UserRecord ur = new UserRecord(newAdmin, pass);
                ur.groups.add("ADMIN");
                userData.put(newAdmin, ur);

                GroupRecord gr = new GroupRecord("ADMIN", newAdmin);
                gr.members.add(newAdmin);
                groupData.put("ADMIN", gr);

                return;
            }
        }
        catch (java.io.IOException e) {
            System.err.println(e);
            return;
        }

        Scanner scanner = null;
        String[] tokens;
        Set<String> groups;
        UserRecord tempRecord; //this is for the loop to add to the list of groups

        try{
             scanner = new Scanner(f);
             while(scanner.hasNextLine()) {

                 // split the line on commas:
                 tokens = scanner.nextLine().split(",");

                 // 1st string is the user, the 2nd is the pass:
                 tempRecord = new UserRecord(tokens[0], tokens[1]);

                 // allocate space for a new set:
                 groups = new HashSet<String>();

                 // add each group to a set:
                 for(int i = 2; i < tokens.length; i++) {
                     groups.add(tokens[i]);
                 }
                 tempRecord.groups = groups;

                 // add the record to our database:
                 userData.put(tokens[0], tempRecord);
             }

        }
        catch (FileNotFoundException e) {System.err.println(e);}
        finally {
            scanner.close();
        }
    }