passes and threads as parameters