The moduli and flow diagram of the program SIR99 are described. New phasing algorithms are proposed working both in direct and in reciprocal space. Their cooperative work is able to solve the structures of both small and large molecules. In particular, small proteins can be solved ab initio without any use of prior information and any user intervention. The efficiency of the various algorithms employed by SIR99 has been tested, and the role of the tangent formula clarified. The user is also provided with some practical information concerning the computer power needed.