FCFS needs refactoring but sort of works