first version that works with binary arryas and supports up to millions of points