First main chunk of code