rewriting from the ground up