todo notes and fixing threading