Making th scheduler