Added encodeWord