Reimplementation of scratch scheduling