Changed win algorithm and tile scan to be more versatile