Two high school students have made a container cap using 3D printing technology that keeps water in a ketchup bottle.

One of the two Liberty North High School seniors who worked on the project told Fox 4 television station in Kansas City they wanted to create a solution for instances when they'd become frustrated by a watery substance mixed with ketchup that came out of the condiment's bottle.

"We would put our cap on, squirt out the ketchup, and we were getting none," Johnathan Thompson said. "We came together and talked about our ideas, which ones would work, which ones wouldn't, which ones were completely ridiculous."

Tyler Richards, the second student on the case collaborated with Thompson as part of a task for class, and the nationwide leadership program Project Lead the Way, which gears students' focus towards science, technology, engineering and math, Fox 4 Kansas City reported.

Richards and Thompson dove into the world of ketchup to found out why the condiment does what it does, immersing themselves fully in the invention process.

"Ketchup undergoes a process called syneresis, which basically is the separation of the tomato paste from the water," Richards said. "We had to design a solution, we had to research the patents, and the science behind the concepts we're exploring. When you turn it over and squeeze it, the water comes out and it's really nasty.

"So the only way out is to go up under the dome, and then through the tube," Richards said explaining the process in a video on Fox 4's website. "And so when you squeeze it out, all the water is sitting on the bottom, and the ketchup is the only stuff that will go through."

The students were almost told to forgo their project.

"Our teacher wasn't even originally going to let us do this idea," Thompson said.