work on encoding