rewriting example problem