start with the code for "brute force" to calculate all possibilites