adding failsafe to php and iterating over predictions to get top 5 that ...