The 4th of July and fireworks go together like peanut butter and jelly and are as American as apple pie, but the sight we will all look forward to seeing this Friday was actually accidentally discovered in China thousands of years ago. Though we also shoot off fireworks to celebrate the New Year, they really take center stage for our nation’s birthday. So, in order to get the most out of your holiday fireworks, here’s a little history, a little science, and a little Insta advice.

If you can’t stand the heat, get out of the kitchen.

Though many of the details have been lost over time, China gets the credit for discovering fireworks over two thousand years ago when a Chinese cook accidentally mixed sulfur, charcoal, and potassium nitrate over fire, causing a loud explosion. This booming noise was believed to scare away evil spirits, so the volatile mixture was poured into bamboo shoots to protect sacred ceremonies and celebrations and thus, the first firework was born. The Crusades brought fireworks back to Europe where they eventually made their way to the Americas with the colonists.

Elementary, my dear Watson

When the night sky erupts in a sparkling array of colors, you can thank chemistry and engineering, the two main fields of knowledge that go in to creating your 4th of July magic. The basic structure of a firework must include an oxidizer (a solid, powder form of oxygen) and a fuel. This makes gunpowder. A firework shell contains various powders that control the length and design of the explosion and is placed within a mortar tube with a fuse at the end. This little rocket is probably what you envision when you think of a typical firework. Once the fuse is lit, the rocket soars into the air and the sky lights up. As for the colors, different chemicals produce different hues. Copper Oxide, for example, produces blue explosions, while Sodium Silicate is responsible for the color yellow.

Just own the night like the 4th of July

You know you already have the perfect Instagram caption ready for the 4th, so now all you need is the perfect picture. For a Katy Perry-worthy firework Insta, keep these four tips in mind. First, focus focus focus. To get a clear shot of the grand finale, tap the phone screen to focus, then hold down to lock it, causing the camera to automatically remember that focus setting. Keeping a steady hand is also important. Try sitting down or leaning against a stationary object to stay away from a blurry mess. This might seem like a no brainer, but turn your flash off since the light will just take away from the light in the sky. Finally, if you really want to get fancy, consider buying a photography app to slow down the shutter speed and let in as much light as possible. Slow Shutter Cam, iLighting Cam, and NightCap are all photographer approved apps worth the small cost.

Now that you have a little history, some science, and tips for Insta fame, you’re ready to celebrate the 4th!