code to compute best chain
Merge remote-tracking branch 'origin/master'