update encodeSymbol method to work for "abc" string