Adding the main code