encapsulate simulations and library
T and t are passed around instead of having them be global