Custom scripts were used to clean the data in Matlab: linear interpolation, rejection of trials with insufficient data, rejecting participants not above chance, etc. Subsequently, custom scripts were built in R for statistical analysis: permutation analysis to assess changes in pupil dilation, mixed models to analyse gaze patterns (gaze direction predicts accuracy or not).