Implemented maxSubSum