Tesis code for TdeA