need to rewrite to actually support threads :|
rewrite in progress