first version of scheduler, checking availability