Tweaking the brute force method: stack allocated arrays, no acos call,
further minor tweaks