use length to reverse string