rewrite the two solutions