fixed stringreversion code