Changing to the bitarray library reduced size significantly.