added string encode/decode functions from class