Added simple pure-python implementation.