Subgoal fixes

This if statement is tricky to read. Maybe break it up into several lines. Especially if you're doing an xor type operation. You could use bool1 ^ bool2.