The invention relates to an apparatus, an algorithm and a method for providing a laser shot file for use in a laser. The laser may be an excimer laser. The shot file may be applied for performing a refractive laser treatment of an eye or for producing a customized contact lens or an intraocular lens. According to the invention information with respect to a desired ablation profile is provided and a first series of laser shot positions is calculated based on the desired ablation profile. A simulated ablation profile is generated using said first series of laser shot positions and using information about pulse characteristics of a single laser shot. The simulated ablation profile is compared with the desired ablation profile and residual structures are determined.