The main code