master: Got folding down to work, trying to generalize but it's hard.