rewrite term exercise - walking a compound structure
more complete rewrite term