sample code for tfg