Replaced Threading with Tasks