added winner check function
fixed merge conflict