http://thisthread.blogspot.com/2014/02/maximum-subarray-by-kadane.html