remove deepcopy in order to save memory