Job Scheduling Algorithm Python