simplified code to tet