added divide and conquer algo