implemented simple scheduler