Made searching for gadgets faster

Added a record of possible endings a gadget can have, so searching is significantly faster than before.