Speeding up clustering by using ints as masks not bool vectors