Added a function that generates a random number which then gets added to the database and the confirmation email