maybe better attack predictor code