Rectifying mistakes done in previous commit, code still works only for permutation enabled operation combinations