Added TAD function

Almost done!