Script to create threads