Current technology for detecting nerve gas or chemical weapons is effective but expensive, and difficult to take out into the field. That’s why a research team from the University of Texas at Austin and Xi’an Jiaotong University in Xi’an set to work creating an alternative that was quick to assemble and had easily replaceable parts, according to New Atlas. That’s how they ended up with a box of Lego bricks and a smartphone.

There are a couple other components inside. A UV lamp at the back of the box shines on a 96-well test plate, which is inserted into the box using a door and ramp built into the front of the box. A square of Lego bricks on the top show where to place the smartphone, which uses the camera to take images of what’s inside the box. Free smartphone software is then used to perform color analysis on the images, which has proven to be highly accurate.

The team posted all of their charts, guides and analytic code on GitHub, in the hopes that that combined with the readily available materials and free software will foster widespread adoption of the technology.