refactored to use objects. Now something random works properly. Added debugging to track down what fact was used