modified func.