fixed todos, added threading