Updated with another version of the reverseString function implemented by Franklin