header seperated, thread functionalities written