Changed create_thread to use the struct