the main code