Added segment generation and update to second thread