Implemented combinations method, got it from rosetta code so I don't quite understand it yet