completed functions starting with T, no tests yet.