runtime optimization by divide and conquer ;)