transforme the for loop of user creation into a recurcive function