added ability to reverse the character sequence