sclogic-phase final version (hopefully)