main tdef