added a thread struct which allows for multiple functions to
be time sliced together at requested intervals