Experiment running slowly

For some reason my experiment is running very slowly in comparison to others I’ve created using psychopy and I am not quite sure why. It uses significantly fewer routines, so I am not sure what else it could be or what to look at next.
When I start the study there are two sets on instructions, the first opens and once I press the key to move forward, it is fine. Then the second set of instructions appear, I press the key to move forward, and it takes a while for it finally to respond. Then everything after this seems to lag more than it should.

I am also having an issue with one of my 4 tasks, in which the experiment is not moving forward as I would expect. Which is odd, because I use the same routine in a previous experiment and had no issues. So something I must have added in a new routine must be causing problems. My experiment folder is attached. It is the “deferred” task I am having issues with. It has it’s own separate routine “def_feedback1” for displaying feedback. When it gets to this routine, this is where the issue occurs.


End Routine

last30 = corr_history[-5:]
avg_acc = (sum(last30))/5
if trial_num % 6 == 0:
    if(avg_acc >=0.8 and trial_num >= 6):
        corr_history = []  #reset correct/incorrect tracker
        Task += 1 #increment task to get new feedback type
        trial_loop.finished = True #finsih loop to get next stimulus set
if trial_num % 6 > 0:
    trial_loop.finished = False #finish 6 trials before quit