added kadane's algorithm