Optimized by using a ball-bounds test
Fixed typo