Change threads to array