powerset revisited, should be functional now.