solution 10: encode