Refactoring #WIP
Refactored code to do every combination
Rewrote to simplify and use tail recursion