problem 1 and 2 for week 3 -- string