Most of us have met that quirky candy connoisseur who only eats pink Skittles or brown M&Ms. Willem Pennings, a mechanical engineering student at the Eindhoven University of Technology in the Netherlands, designed a device to make life easier for these discerning eaters: a candy-sorting machine.

On his blog, Pennings describes how the sorting machine—which was created using CAD software and contains 3D-printed parts—works. Users pour mixed candies into a funnel, and a tiny nozzle shoots same-colored sweets into their respective dishes. This process is made possible thanks to an RGB sensor (a color-sensing device). It can detect—and categorize—any type of item, so long as the individual pieces are regularly and evenly shaped.

Once in action, the machine works fast: It takes only two to three minutes to sort a 300-gram bag of Skittles or M&Ms, and it can sort two pieces per second.

Visit Pennings’s blog for a step-by-step tutorial on how to make your own candy-sorting machine. Keep in mind, however, that the project may take a long time, and cost a lot of money: Pennings himself worked on his own machine from May 2016 until last December, and spent nearly €500 (more than $530) on its parts and software.

[h/t The Kid Should See This]