shuffle functions between files.
only define t once.