It is widely believed that adaptive optics only has a role in correcting turbulent wavefronts on large telescopes using very bright reference stars. Unfortunately these are very scarce and many astronomical targets require wavefront correction to work over much of the sky. We therefore need to be able to use very much fainter reference objects. Laser guide stars in principle can allow 0.1 arcsecond resolution but have a number of severe technical problems that limit their application. Our aims are to provide imaging at even higher resolution than Hubble. Lucky Imaging completely eliminates the tip-tilt errors in astronomical wavefront detection. Most of the power that remains is in low order, large scale structures. These may be detected with high sensitivity using photon-counting EMCCD detectors working at high frame rate, up to ~100Hz. With a new design of curvature wavefront sensor, wavefront errors may be measured and corrected to give near diffraction-limited performance on large groundbased telescopes in the visible. Reference stars (and reference compact galaxies) fainter than I~17.5 mag may be used routinely. This paper will describe how these work, what detector and other hardware is needed and what software should be used to measure the wavefront errors and drive deformable mirror hardware. The software techniques that are used are those routinely applied for MRI and CT imaging. They are fast and relatively easy to implement. The net effect is that imaging systems can be constructed that improve substantially over Hubble resolution from the ground for a relatively modest sum of money.