Carpoolzwolle's improved Algorithm in O(N!)