Soln to min encoding problem.