some basic rewriting, plus test with Peano numbers