fixed problem 3 encoding