Implemented basic multi-thread correctly.