Started on a few helper functions
Added raise exception for invalid threadIds