1. Add a new mode for keeping the stones with the specified colors.
2. Integrate the new global variables into the network function.