Added recording of the pupil information and outpting in a new file