removed debugging code
smattering of bugs to do with invalidated tasks