Implement transforms. This still includes some debugging code which