# CPU Scheduling - Round Robin order on ready queue

I am attempting the question below:

Assume a set of processes $P_1, P_2, P_3$ and $P_4$ arrive at different times in the ready queue. The table below shows the burst time, the priority (smallest priority number implies highest priority) and arrival time for each of the processes. \begin{array}{|c|c|c|c|} \hline Process & Burst ~ time & Priority & Arrival ~ Time \\ \hline P_1 & 8& 2& 0\\ \hline P_2 & 2 & 3 & 1 \\ \hline P_3 & 4 & 1 & 3 \\ \hline P_4 & 6 & 2 & 5 \\ \hline \end{array} Draw a Gant chart, illustrating the execution of the processes, to demonstrate each of the following algorithms.

1. First-Come, First-Served (FCFS)
2. Round Robin(RR) with time slice of 3 time units.

Problem I am having is that my answer is not matching what I am getting form the simulator here.

The problem might be with the way I am handling my ready Queue. My workings and answer is below. The simulator shows that after first time P3 appears in the chart that P4 should start. But P1 was pre-empted and still had more execution hence I put P1 in there. Where am I going wrong?

Ready Queue (as I was working it out): P1,P2,P3,P1,P4,P3,P1,P4

GANT CHART:

Process Last-run Time-left