add algorithm to reverse string