Apparatus for providing a laser shot file for use in a laser, preferably an excimer laser to preferably perform a refractive laser treatment of an eye or to produce a custom contact lens or an intraocular lens including: a) means for providing information with with respect to a desired ablation profile; b) means for calculating a first series of laser firing positions based on the desired ablation profile; c) means for generating a simulated ablation profile using said first series of laser firing positions and using information about the energy distribution on a pulse of a single laser firing; d) means for comparing the simulated ablation profile with the desired ablation profile and determining residual structures; e) means for calculating a second series of laser firing positions based on the desired ablation profile and the determined residual structures, where the desired ablation profile is calculated based on wavefront information obtained for the eye to be treated, where the wavefront information is given in Zernike coefficients, where the wavefront information is given as a nth order wavefront and where said first series of laser firing positions is calculated based on said wavefront nth order wave, where the difference between the simulated ablation profile and the desired ablation profile is determined by calculating the difference of the simulated wave front and the desired wave front to obtain a residual wave front, where the front of residual wave is described with Zernike coefficients, where for the next iteration the residual wavefront is added to the previously calculated wavefront, where the difference of fr Simulated and desired wave entities are filtered to obtain low and / or high spatial frequencies by calculating Zernike coefficients up to the order N 'and where in each iteration step a N'-th respective order of the Zernike coefficients is used and where N '>; = n-2 * iteration_counter, where n is the order of the wavefront information and i