some drm alg in python