commit
added permutation test
fixed: rank was missing from arguments