fixed errors, sorted procecesses by arrival for faster searching