Updated .plan with thread psudocode