added divide and conquer concept