Word Counter Using the Foundation API