private int generateContactId() {
        // Generates a random 6 digit integer as the ID number.
        int newId = (int)(Math.random()*999999);
        // Then checks to see if this number is already in use recursively.
        if(getContactFromID(newId) != null) {
            return generateContactId(); 
        } else {
            return newId;
        }
    }