add a multi-thread approach