Gravitational lensing is one of most promising tools to probe dark energy and dark matter in our Universe. Lensing by larger-scale structures distorts the shape of background galaxies. For ground-based observations the shape is further distorted by atmospheric turbulence and optical distortions. Many algorithms were proposed to measure the shear signal but the systematic biases are still too large to be acceptable for the larger-sky surveys in the future. I will present our new algorithms for PSF reconstruction and shape measurements based on several sets of basis functions.