updated to provide encoding.