added saccade detection function