give each thread its own function pointer