make threads only join on their children
don't get stuck in an endless loop
only delete globals at the very end
stop screen getting wiped
trying to increase speed and save memory
further tidy
tidy
testing limits
commented out debugging code
different headers, use __REENTRANT
remove time references
remove time references x2
remove time references x3