very nieve py3 convertion for icard support, at least.