potato; more tweaks; actually cleaned some of the code