completed functions for string challenge