start the main algorithm section