the python encoder seems cleaner to me