Original rdpeng implementation.