Added code to sort processes by arrival time