Better reg implementation