thread function, give it an int pointer