Ported into Pure Python
obsolete