Fixed defineBorders with upper and lower borders
Added path searching: 2 patterns implemented
Check win BEFORE adding checkrule