Basic code copypaste from TPPITweaks. Untested, unfinished.