Re-wrote the thread mechanism, changed graphing library