Why did you remove the encode function here?