exercise 5.13 takeWhileViaUnfold implemented