Optimization of an Exit Pupil Expander with 1D gratings