Confused ... help me?

I'm a junior in high school so I've had my period for a few years now and it's always on time, never irregular but this time was weird. I was supposed to get it July 9th but I missed it and I was worried that I was pregnant because it was a long time without getting but I ended up getting it four days ago on July 23rd so I'm very confused and was wondering if anyone knew why I got my period 2 weeks late.