Code enhancements & Win Detection Prep

We're trying to re-write some of the code to make it more efficient,
with thought of win detection to be done soon.