first stage of the program