update to make search work with fewer instructions
current version with 3-bit registers