binary tree max path sum reimpl