An scala example of reversing words