I think it works now, got the permutations of skeleton indices done correctly