Main code of the tutorial part1