Main code.