td function implemented