-- push to seperate function in prepartion for multithreating