Fix function for username with spaces
Updated function documentation
Fixed function for various input types & added comments

Includes tests