Basic enc/dec working for strings less than 500 char
changed weight to string function