In this paper we present an extremely simple structure solution method termed charge flipping. It works ab initio on high resolution x-ray diffraction data in the manner of Fourier recycling. The real space modification simply changes the sign of charge density below a threshold, while in reciprocal space the modification is the Fobs map without any weighting. We test the algorithm using synthetic data for a wide range of structures, analyse the solution statistics and check the quality of reconstruction. Finally, we reconsider mathematical aspects of the algorithm in detail, showing that in this chaotic iteration process the solution is a limit cycle and not a fixed point.