The main function

The main function