implement string revers function