rewriting for fun