Optimized BoxPartition

Should be just a bit faster now with bigger arrays..