Sort method finalized. maxSubSum gives proper answer.