changed Shape.getAllPermutations() to use LinkedList (cleaner in current usage scenario)