I have been trying to modify either the code generating all possible combinations either here by lazy dog or here. (Both are great solutions solving the same problem)