Added lose condition checking
Added win condition checking