Zach, can you check my general algorithm?