wrote a simple scheduler