rewrite the problem