restructure + changes to threadoptimiser and mnist