returning a hash is not necessary, and just gets in the way
testing empty string input
adding documentation for function