removed deepcopy, cleaned more comments