minor rewritten