TEI Developing a program logic