updating for better string encoding