  We suggest a new algorithm to remove systematic effects in a large set of
lightcurves obtained by a photometric survey. The algorithm can remove
systematic effects, like the ones associated with atmospheric extinction,
detector efficiency, or PSF changes over the detector. The algorithm works
without any prior knowledge of the effects, as long as they linearly appear in
many stars of the sample. The approach, which was originally developed to
remove atmospheric extinction effects, is based on a lower rank approximation
of matrices, an approach which was already suggested and used in chemometrics,
for example. The proposed algorithm is specially useful in cases where the
uncertainties of the measurements are unequal. For equal uncertainties the
algorithm reduces to the Principal Components Analysis (PCA) algorithm. We
present a simulation to demonstrate the effectiveness of the proposed algorithm
and point out its potential, in search for transit candidates in particular.
