Removed deepcopy as it seems to cause badness