scheduler algorithm-2