Looking back you were able to identify all of the things that you might have done differently to effect the outcome of the ride. That's great! What a wonderful realization and learning experience. Next time you'll know to eat more, etc. Biking is about constantly learning and making little tweaks. Mentally it's hard for anyone to stay in the game if you're bonking because your brain is fueled by glucose, which you weren't getting enough of. Good luck and keep plugging away. You'll get there!