Added th to logic