July 8 2014 checkout older version from July 1st, 251b633fc5ebe28673fe45c0f3c6735ab57d721e, restore permutation methods