threading
implemented working threading model