Added combinatrics function