prediction and other experiments, some refactoring