Fixed compose() to allow for PERMUTATION_INDEX to vary