Adding in logic for flagging, winning, and losing. Initial prototype working