implement string reverser as exercise