implementation for sjf preemp