speedup, need more complex priority algorithm