Updated functions with a name input