wrapped everything in work(self,data)