Adding the main solution