Implement winner tree
Add test case
Minor updates