cont. working on pseudocode for scheduler