Modify the functions scope from global to local
Add a function to handle client adding to the list