  The aimed high sensitivities and large fields of view of the new generation
of interferometers impose to reach high dynamic range of order $\sim$1:$10^6$
to 1:$10^8$ in the case of the Square Kilometer Array. The main problem is the
calibration and correction of the Direction Dependent Effects (DDE) that can
affect the electro-magnetic field (antenna beams, ionosphere, Faraday rotation,
etc.). As shown earlier the A-Projection is a fast and accurate algorithm that
can potentially correct for any given DDE in the imaging step. With its very
wide field of view, low operating frequency ($\sim30-250$ MHz), long baselines,
and complex station-dependent beam patterns, the Low Frequency Array (LOFAR) is
certainly the most complex SKA precursor. In this paper we present a few
implementations of A-Projection applied to LOFAR that can deal with non-unitary
station beams and non-diagonal Mueller matrices. The algorithm is designed to
correct for all the DDE, including individual antenna, projection of the
dipoles on the sky, beam forming and ionospheric effects. We describe a few
important algorithmic optimizations related to LOFAR's architecture allowing us
to build a fast imager. Based on simulated datasets we show that A-Projection
can give dramatic dynamic range improvement for both phased array beams and
ionospheric effects. We will use this algorithm for the construction of the
deepest extragalactic surveys, comprising hundreds of days of integration.
