Forked version of SuperD_legacy